package com.xnyzc.lhy.common.penum.driver;

public enum ESexType {

    man("1","男"),
    woman("2", "女"),
    confidentiality("3", "保密"),
    notSet("4", "未设置");

    private String type;
    private String value;

    ESexType(String type, String value){
        this.type = type;
        this.value = value;
    }


    public static ESexType findById(String type){
        ESexType eSexType;
        switch (type){
            case "1":
                eSexType  = ESexType.man;
                break;
            case "2":
                eSexType = ESexType.woman;
                break;
            case "3":
                eSexType = ESexType.confidentiality;
                break;
            case "4":
                eSexType = ESexType.notSet;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eSexType;
    }

    public String getValue() {
        return this.value;
    }
}
